<template>
  <!-- 訂單管理 -->
  <a-card
    :width="1000"
  >
    <table class="order-table">
      <tr>
        <th colspan="4">订单信息</th>
      </tr>
      <tr>
        <td style="width: 220px">订单号</td>
        <td style="width: 300px">{{ model.orderNumber }}</td>
        <td style="width: 220px">汽车报价金额</td>
        <td>{{ model.quoteAmount | filterNumber(model.quoteAmount)}}</td>
      </tr>
      <tr>
        <td>订/定金金额</td>
        <td>{{ model.epositAmount | filterNumber(model.epositAmount)}}</td>
        <td>订单生成时间</td>
        <td>{{ model.orderDate | filterTime(model.orderDate) }}</td>
      </tr>
      <tr>
        <td>订/定金性质</td>
        <td v-if="model.depositAttribute == '1'">可退</td>
        <td v-else-if="model.depositAttribute == '2'">不可退</td>
        <td v-else-if="model.depositAttribute == '3'">有条件可退</td>
        <td v-if="model.depositAttribute != '1'">订/定金不可退原因</td>
        <td v-if="model.depositAttribute != '1'">{{ model.depositNotes }}</td>
<!--        <td v-if="model.depositAttribute != '1'">订/定金描述</td>-->
<!--        <td v-if="model.depositAttribute != '1'">{{ model.depositContent }}</td>-->
        <td v-if="model.depositAttribute == '1'" colspan="2"></td>
      </tr>

      <tr>
        <th colspan="4">销售方信息</th>
      </tr>
      <tr>
        <td>企业名称</td>
        <td>{{ model.enterpriseName }}</td>
        <td>社会信用统一代码</td>
        <td>{{ model.enterpriseUscc }}</td>
      </tr>
      <tr>
        <td>销售区域</td>
        <td>{{ model.region }}</td>
        <td>销售地址</td>
        <td>{{ model.businessAddress }}</td>
      </tr>
      <tr>
        <td>销售顾问姓名</td>
        <td>{{ model.salesName }}</td>
        <td>销售顾问手机号码</td>
        <td>{{ model.salesPhone }}</td>
      </tr>

      <tr>
        <th colspan="4">订购方信息</th>
      </tr>
      <tr>
        <td>订购方姓名</td>
        <td>{{ model.ownerName }}</td>
        <td>订购方电话</td>
        <td>{{ model.ownerPhone }}</td>
      </tr>
      <tr>
        <td>订购方证件类型</td>
        <td v-if="model.documentType == 1">身份证</td>
        <td v-else-if="model.documentType == 2">护照</td>
        <td v-else-if="model.documentType == 3">士兵证军官证</td>
        <td v-else-if="model.documentType == 4">港澳居民居住证</td>
        <td v-else-if="model.documentType == 5">港澳居民来往内地通行证</td>
        <td v-else-if="model.documentType == 6">台湾居民居住证</td>
        <td v-else-if="model.documentType == 7">台湾居民来往大陆通行证</td>
        <td v-else-if="model.documentType == 8">外国人永久居留身份证</td>
        <td v-else-if="model.documentType == 9">其他有效身份证明</td>
        <td v-else>{{ model.documentType }}</td>
        <td>订购方证件号码</td>
        <td>{{ model.documentNumber }}</td>
      </tr>

      <tr>
        <th colspan="4">车辆信息</th>
      </tr>
      <tr>
        <td>汽车品牌</td>
        <td>{{ model.carBrand }}</td>
        <td>汽车车型</td>
        <td>{{ model.carModel }}</td>
      </tr>
      <tr>
        <td>车架号(vin码)</td>
        <td>{{ model.carVin }}</td>
        <td>汽车类型</td>
        <td v-if="model.carType == 1">传统车</td>
        <td v-else-if="model.carType == 2">新能源汽车</td>
        <td v-else>{{ model.carType }}</td>
      </tr>
      <tr>
        <td>车型配置</td>
        <td>{{ model.carTypeConfiguration}}</td>
        <td>汽车燃料类型</td>
        <td v-if="model.fuelType == 1">油/电</td>
        <td v-else-if="model.fuelType == 2">电</td>
        <td v-else-if="model.fuelType == 3">油</td>
        <td v-else>{{ model.fuelType }}</td>
      </tr>
      <tr>
        <td>是否为新车</td>
        <td>{{ model.isNewCar }}</td>
        <td>进口机动车辆随车检验单号</td>
        <td>{{ model.importEngineNumber }}</td>
      </tr>
      <tr>
        <td>外饰颜色</td>
        <td>{{ model.carColor }}</td>
        <td>内饰颜色</td>
        <td>{{ model.interiorColor }}</td>
      </tr>
      <tr>
        <td>发动机号</td>
        <td>{{ model.engineNumber }}</td>
        <td>合格证号</td>
        <td>{{ model.qualifiedNumber }}</td>
      </tr>
      <tr>
        <td>动力蓄电池组编号</td>
        <td>{{ model.batteryNumber }}</td>
        <td>货物进口证明书编号</td>
        <td>{{ model.importProveNumber }}</td>
      </tr>


    </table>
  </a-card>
</template>

<script>
import moment from 'moment'

export default {
  name: 'orderInfo',
  props:{
    model:{
      type:Object,
      default:()=>{}
    }
  },
  data() {
    return {
      confirmLoading: false,
    }
  },
  methods: {

  },
  filters: {
    filterTime(time) {
      return time? moment(time).format('YYYY-MM-DD') :''
    },
    filterNumber(value){
      return value? Number(value).toFixed(2) + '元':''
    }
  },
}
</script>

<style lang="less" scoped>
.order-table {
  width: 100%;
  margin: 10px auto;
}
.order-table tr th {
  height: 30px;
  border: 1px solid #000;
  background-color: #e6e6e6;
  padding-left: 5px;
}
.order-table tr td {
  height: 30px;
  border: 1px solid #000;
  min-width: 80px;
  text-align: center;
}

</style>